package com.example.test_event_and_callback.impl;

import com.example.test_event_and_callback.infras.async.ano.AsyncDataProvider;
import com.example.test_event_and_callback.infras.async.ano.Demander;
import org.springframework.stereotype.Service;

@Service
public class TestProviderService {

    @AsyncDataProvider({
            @Demander(demander = TestAsyncDto.class,param = "name"),
            @Demander(demander = TestDto.class, param = "name")
    })
    public String getDtoName(String str){
//        System.out.println(Thread.currentThread());
//        System.out.println("getName");
//        try {
//            System.out.println(Thread.currentThread());
//            Thread.sleep(1000);
//        } catch (InterruptedException e) {
//            throw new RuntimeException(e);
//        }
        return "臭狗屎";
    }

    @AsyncDataProvider({
            @Demander(demander = TestAsyncDto.class,param = "id"),
            @Demander(demander = TestDto.class, param = "id")
    })
    public String getDtoId(String str){
//        System.out.println(Thread.currentThread());
//        System.out.println("getId");
//        try {
//            System.out.println(Thread.currentThread());
//            Thread.sleep(1000);
//        } catch (InterruptedException e) {
//            throw new RuntimeException(e);
//        }
        return "250";
    }

    @AsyncDataProvider({
            @Demander(demander = TestAsyncDto.class,param = "address"),
            @Demander(demander = TestDto.class, param = "address")
    })
    public String getText(String str){
        return "250";
    }
    @AsyncDataProvider({
            @Demander(demander = TestAsyncDto.class,param = "mother"),
            @Demander(demander = TestDto.class, param = "mother")
    })
    public String getMother(String str){
        return "250";
    }
    @AsyncDataProvider({
            @Demander(demander = TestAsyncDto.class,param = "father"),
            @Demander(demander = TestDto.class, param = "father")
    })
    public String getFather(String str){
        return "250";
    }
    @AsyncDataProvider({
            @Demander(demander = TestAsyncDto.class,param = "culture"),
            @Demander(demander = TestDto.class, param = "culture")
    })
    public String getCulture(String str){
        return "250";
    }
    @AsyncDataProvider({
            @Demander(demander = TestAsyncDto.class,param = "nickname"),
            @Demander(demander = TestDto.class, param = "nickname")
    })
    public String geyNickname(String str){
        return "250";
    }

    @AsyncDataProvider({
            @Demander(demander = TestAsyncDto.class,param = "text"),
            @Demander(demander = TestDto.class, param = "text")
    })
    public String getDtoText(String str){
        return "我臭狗屎就是250";
    }
}
